const path=require('path')

module.exports={
    entry:'./src/main.js',
    output:{
        path:path.resolve(__dirname,'dist'), //绝对路径
        filename:'bundle.js',
        publicPath:'dist/'
    },
    module: {
        rules: [
            {
                test: /\.css$/,
                //css-loader 负责加载css
                //style-loader 负责将样式添加到DOM 
                //从右向左使用loader
                use: [ 'style-loader', 'css-loader' ]
            },
            {
                test: /\.(png|jpg|gif)$/,
                use: [
                    {
                        loader: 'url-loader',
                        options: {
                        limit: 8196
                        }
                    }
                ]
            },
            {
                test: /\.(png|jpg|gif)$/,
                use: [
                    {
                        loader: 'file-loader',
                        options: {}
                    }
                ]
            }
        ]
    }
}